package com.back;

import com.frame.struts.BaseBean;

import java.io.IOException;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.utils.CommUtil;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;

/**
 * <p>
 * Title:
 * </p>
 * <p>
 * Description:
 * </p>
 * <p>
 * Copyright: Copyright (c) 2006
 * </p>
 * <p>
 * Company:
 * </p>
 * 
 * @author not attributable
 * @version 1.0
 */

public class UserRightForm extends BaseBean {
	UserRightEntity ure = new UserRightEntity();
	private int oldId = 0;

	public UserRightForm() {
	}

	public String addUserRight() {
		HttpServletRequest request = ActionContext.getActionContext()
				.getRequest();
		HttpServletResponse response = ActionContext.getActionContext()
				.getResponse();
		BackFactory factory = new BackFactory();
		ure.setOptdate(new Date());
		ure.setOptrid(CommUtil.getUserId(request));
		System.out.println("add--" + ure.getJbxx());
		try {
			if (factory.addUserRight(ure)) {
				response.sendRedirect("/back/editright.jsp");
			} else {
				response.sendRedirect("/failed.jsp");
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public int getOldId() {
		return this.oldId;
	}

	public void setOldId(int oldId) {
		this.oldId = oldId;
	}

	public String modifyUserRight() {
		HttpServletRequest request = ActionContext.getActionContext()
				.getRequest();
		HttpServletResponse response = ActionContext.getActionContext()
				.getResponse();
		BackFactory factory = new BackFactory();
		ure.setOptdate(new Date());
		ure.setOptrid(CommUtil.getUserId(request));
		// factory.deleteUserRight(this.getOldId());
		ure.setJsid(this.getOldId());
		logger.debug(ure);
		try {
			if (factory.updateUserRight(ure)) {
				response.sendRedirect("/back/editright.jsp");
			} else {
				response.sendRedirect("/failed.jsp");
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}

	public int getWyl() {
		return ure.getWyl();
	}

	public void setWyl(int wyl) {
		ure.setWyl(wyl);
	}

	public int getWlxxqx() {
		return ure.getWlxxqx();
	}

	public void setWlxxqx(int wlxxqx) {
		System.out.println("form wlxxqx=" + wlxxqx);
		ure.setWlxxqx(wlxxqx);
		System.out.println("fkdk" + ure.getWlxxqx());
	}

	public int getCwfx() {
		return ure.getCwfx();
	}

	public void setCwfx(int cwfx) {
		ure.setCwfx(cwfx);
	}

	public int getCwfxqx() {
		return ure.getCwfxqx();
	}

	public void setCwfxqx(int cwfxqx) {
		ure.setCwfxqx(cwfxqx);
	}

	public int getCwfxfw() {
		return ure.getCwfxfw();
	}

	public void setCwfxfw(int cwfxfw) {
		ure.setCwfxfw(cwfxfw);
	}

	public int getFxgl() {
		return ure.getFxgl();
	}

	public void setFxgl(int fxgl) {
		ure.setFxgl(fxgl);
	}

	public int getFxglqx() {
		return ure.getFxglqx();
	}

	public void setFxglqx(int fxglqx) {
		ure.setFxglqx(fxglqx);
	}

	public int getFxglfw() {
		return ure.getFxglfw();
	}

	public void setFxglfw(int fxglfw) {
		ure.setFxglfw(fxglfw);
	}

	public int getJbxx() {
		return ure.getJbxx();
	}

	public void setJbxx(int jbxx) {
		ure.setJbxx(jbxx);
	}

	public int getJbxxqx() {
		return ure.getJbxxqx();
	}

	public void setJbxxqx(int jbxxqx) {
		ure.setJbxxqx(jbxxqx);
	}

	public int getJbxxfw() {
		return ure.getJbxxfw();
	}

	public void setJbxxfw(int jbxxfw) {
		ure.setJbxxfw(jbxxfw);
	}

	public String getJsmc() {
		return ure.getJsmc();
	}

	public void setJsmc(String jsmc) {
		ure.setJsmc(jsmc);
	}

	public int getWlxx() {
		return ure.getWlxx();
	}

	public void setWlxx(int wlxx) {
		ure.setWlxx(wlxx);
	}

	public int getWlxxfw() {
		return ure.getWlxxfw();
	}

	public void setWlxxfw(int wlxxfw) {
		ure.setWlxxfw(wlxxfw);
	}

	public int getXtgl() {
		return ure.getXtgl();
	}

	public void setXtgl(int xtgl) {
		ure.setXtgl(xtgl);
	}

	public int getNdbg() {
		return ure.getNdbg();
	}

	public void setNdbg(int ndbg) {
		ure.setNdbg(ndbg);
	}

	public int getXybz() {
		return ure.getXybz();
	}

	public void setXybz(int xybz) {
		ure.setXybz(xybz);
	}

	public int getXybzqx() {
		return ure.getXybzqx();
	}

	public void setXybzqx(int xybzqx) {
		ure.setXybzqx(xybzqx);
	}

	public int getXypj() {
		return ure.getXypj();
	}

	public void setXypj(int xypj) {
		ure.setXypj(xypj);
	}

	public int getXypjqx() {
		return ure.getXypjqx();
	}

	public void setXypjqx(int xypjqx) {
		ure.setXypjqx(xypjqx);
	}

	public int getXypjbg() {
		return ure.getXypjbg();
	}

	public void setXypjbg(int xypjbg) {
		ure.setXypjbg(xypjbg);
	}

	public int getXypjbgqx() {
		return ure.getXypjbgqx();
	}

	public void setXypjbgqx(int xypjbgqx) {
		ure.setXypjbgqx(xypjbgqx);
	}

	public int getXypjbgfw() {
		return ure.getXypjbgfw();
	}

	public void setXypjbgfw(int xypjbgfw) {
		ure.setXypjbgfw(xypjbgfw);
	}

	public int getXypjfw() {
		return ure.getXypjfw();
	}

	public void setXypjfw(int xypjfw) {
		ure.setXypjfw(xypjfw);
	}

	public int getJbmfx() {
		return ure.getJbmfx();
	}

	public void setJbmfx(int jbmfx) {
		ure.setJbmfx(jbmfx);
	}

	public int getJbmfxqx() {
		return ure.getJbmfxqx();
	}

	public void setJbmfxqx(int jbmfxqx) {
		ure.setJbmfxqx(jbmfxqx);
	}

	public int getJbmfxfw() {
		return ure.getJbmfxfw();
	}

	public void setJbmfxfw(int jbmfxfw) {
		ure.setJbmfxfw(jbmfxfw);
	}

	public int getGdjryzzgl() {
		return ure.getGdjryzzgl();
	}

	public void setGdjryzzgl(int gdjryzzgl) {
		ure.setGdjryzzgl(gdjryzzgl);
	}

	public int getGdjryzzglfw() {
		return ure.getGdjryzzglfw();
	}

	public void setGdjryzzglfw(int gdjryzzglfw) {
		ure.setGdjryzzglfw(gdjryzzglfw);
	}

	public int getGdjryzzglqx() {
		return ure.getGdjryzzglqx();
	}

	public void setGdjryzzglqx(int gdjryzzglqx) {
		ure.setGdjryzzglqx(gdjryzzglqx);
	}

	public int getShxyxxfx() {
		return ure.getShxyxxfx();
	}

	public void setShxyxxfx(int shxyxxfx) {
		ure.setShxyxxfx(shxyxxfx);
	}

	public int getShxyxxfxfw() {
		return ure.getShxyxxfxfw();
	}

	public void setShxyxxfxfw(int shxyxxfxfw) {
		ure.setShxyxxfxfw(shxyxxfxfw);
	}

	public int getShxyxxfxqx() {
		return ure.getShxyxxfxqx();
	}

	public void setShxyxxfxqx(int shxyxxfxqx) {
		ure.setShxyxxfxqx(shxyxxfxqx);
	}

	public int getKhjyzk() {
		return ure.getKhjyzk();
	}

	public void setKhjyzk(int khjyzk) {
		ure.setKhjyzk(khjyzk);
	}

	public int getKhjyzkfw() {
		return ure.getKhjyzkfw();
	}

	public void setKhjyzkfw(int khjyzkfw) {
		ure.setKhjyzkfw(khjyzkfw);
	}

	public int getKhjyzkqx() {
		return ure.getKhjyzkqx();
	}

	public void setKhjyzkqx(int khjyzkqx) {
		ure.setKhjyzkqx(khjyzkqx);
	}

}
